package cate.game.role.farm.endless.msg;

import cate.common.util.GameResult;
import cate.game.GameBody;
import cate.game.client.ClientContext;
import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgInput;
import cate.game.client.msg.id.MsgIdBEndless;
import easy.java.dev.note.NoteField;

@ClientMsg(title = "领取首通奖励 の 请求")
public class EndlessRewardFirstPassReq implements MsgInput {
    @NoteField("要领取的关卡id")
    public int targetCombatNum;

    @Override
    public void execute(GameBody game, ClientContext cc) {
        GameResult<Void> r = cc.getRole().getFarm().endless.tryToGetFirstPassReward(targetCombatNum);
        if (!r.ok()) {
            game.notice.message(cc.getRole(), r);
        }
    }

    @Override
    public MsgConfig conf() {
        return MsgIdBEndless.FIRST_REWARD_GET_REQ;
    }
}
